#ifndef _SCENE_H
#define _SCENE_H

#include <string>
#include <map>

#include "Camera.h"
#include "Matrix4.h"
#include "GameObject.h"
#include "GameInfo.h"
#include "UIControl.h"
#include "Colour.h"
#include "ResourceManager.h"
#include "SoundManager.h"
#include "Environment.h"

#ifdef GALLIUMENGINE_DLL 
#define GALLIUMENGINE_API __declspec( dllexport )
#else
#define GALLIUMENGINE_API __declspec( dllimport )
#endif

namespace GalliumEngine
{

	class Scene
	{
	private:
		typedef std::map<std::string,GameObject*> objects_map;
		typedef objects_map::iterator objects_map_itr;
		typedef objects_map::const_iterator objects_map_const_itr;
		typedef std::pair<std::string,GameObject*> objects_pair;

		typedef std::map<std::string,UIControl*> ui_map;
		typedef ui_map::iterator ui_map_itr;
		typedef ui_map::const_iterator ui_map_const_itr;
		typedef std::pair<std::string,UIControl*> ui_pair;

		objects_map objects;
		ui_map ui;

		std::string id;

		//Camera* activePerspectiveCamera;
		//Camera* activeOrthographicCamera;

		Colour clearColour;

		Environment* environment;

		std::vector<BindParams> params;
	public:
		GALLIUMENGINE_API Scene(void);
		GALLIUMENGINE_API Scene(std::string _id);
		GALLIUMENGINE_API virtual ~Scene(void);
		GALLIUMENGINE_API std::string getId() const;

		GALLIUMENGINE_API void addObject(GameObject *object);
		GALLIUMENGINE_API void removeObject(std::string _id);
		GALLIUMENGINE_API GameObject* getObject(std::string _id);
		
		/*GALLIUMENGINE_API void addUIControl(UIControl *ui);
		GALLIUMENGINE_API void removeUIControl(std::string _id);
		GALLIUMENGINE_API UIControl* getUIControl(std::string _id);*/

		GALLIUMENGINE_API void setClearColour(Colour c);

		GALLIUMENGINE_API Environment* getEnvironment();
		GALLIUMENGINE_API void setEnvironment(Environment* _environment);

		GALLIUMENGINE_API virtual void initialize();
		GALLIUMENGINE_API virtual void deinitialize();
		GALLIUMENGINE_API virtual void update(float delta);
		GALLIUMENGINE_API virtual void draw();

		//GALLIUMENGINE_API Camera* getActivePerspectiveCamera();
		//GALLIUMENGINE_API void setActivePerspectiveCamera(std::string id);

		//GALLIUMENGINE_API Camera* getActiveOrthographicCamera();
		//GALLIUMENGINE_API void setActiveOrthographicCamera(std::string id);
	};

}

#endif

